/**
 * *****************************************************************************
 * @file    scan.h
 * @author  Jack
 * @version 1.0.0
 * @date    2022-05-27
 * @brief   the procedure for radar scanning.
 * 
 *                 Copyright (c) 2021, Andar Technologies Inc.
 *                           www.andartechs.com
 * 
 * *****************************************************************************
 */

#ifndef __SCAN_H
#define __SCAN_H

/*----------------------------- include --------------------------------------*/

#include "adt3102_type_define.h"
#include "common.h"
#include "adt3102_system.h"
#include "adt3102.h"
#include "fft.h"

/*----------------------------- define ---------------------------------------*/

/*------------------------------ typedef -------------------------------------*/

typedef struct
{
    uint8                       configSource;
    AnalogDataStrTypedef        chirpStr;
}scanStrParasTypedef;

/*------------------------------ function ------------------------------------*/

/**
 * @brief   initialize all related parameters for scanning.
 * @param   None.
 * @return  None.
 * @note
 */
void  adt3102ScanInit(void);

/**
 * @brief   adc Sample.
 * @param   None.
 * @return  None.
 * @note
 */
void adcSample(void);

/**
 * @brief   Send Single chirp , collect ADC and do ragne fft.
 * @param   uint32 space.  The integer between single chip, unit: macro second
 * @param   dspMemoryStgrTypedef.
 *          See the @dspMemoryStgrTypedef member for details.
 * @return  None.
 * @note
 */
void SendChirpsSingle(dspMemoryStgrTypedef *memory);

/**
 * @brief   Send all chirp , collect ADC and do ragne fft.
 * @param   uint32 space.  The integer between single chip, unit: macro second
 * @param   dspMemoryStgrTypedef.
 *          See the @dspMemoryStgrTypedef member for details.
 * @return  None.
 * @note
 */
void SendChirpsCont(dspMemoryStgrTypedef *memory);

/**
 * @brief   Send chirp , collect ADC and do ragne fft.
 * @param   uint32 space.  The integer between single chip, unit: macro second
 * @param   dspMemoryStgrTypedef.
 *          See the @dspMemoryStgrTypedef member for details.
 * @return  None.
 * @note
 */
void SendChirpsSingle(dspMemoryStgrTypedef *memory);

/**
 * @brief   power on a few of RF modules, which take a few more
 *          time to wake up again stably.
 * @param   None.
 * @return  None.
 * @note
 */
void doPowerOnSlowRf(void);

/**
 * @brief   power off a few of RF modules, which take a few more
 *          time to wake up again stably.
 * @param   None.
 * @return  None.
 * @note
 */
void doPowerOffSlowRf(void);

/**
 * @brief   get pointer to struct @scanStrParasTypedef.
 * @param   None.
 * @return  scanStrParasTypedef*: pointer to scanStrParasTypedef
 *          See the @scanStrParasTypedef member for details.
 * @note
 */
scanStrParasTypedef* getScanStrPara(void);

#endif
